Shared cache parsing and pre-fetch

ABSTRACT

The invention provides a method and system for reducing latency in reviewing and presenting web documents to the user. A cache coupled to one or more web clients request web documents from web servers on behalf of those web clients and communicates those web documents to the web clients for display. The cache parses the web documents as they are received from the web server, identifies references to any embedded objects, and determines if those embedded objects are already maintained in the cache. If those embedded objects are not in the cache, the cache automatically pre-fetches those embedded objects from the web server without need for a command from the web client. The cache maintains a two-level memory including primary memory and secondary mass storage. At the time the web document is received, the cache determines if any embedded objects are maintained in the cache but are not in primary memory. If those embedded objects are not in primary memory, the cache automatically pre-fetches those embedded objects from secondary mass storage to primary memory without need for a request from the web client. Web documents maintained in the cache are periodically refreshed, so as to assure those web documents are not stale. The invention is applied both to original requests to communicate web documents and their embedded objects from the web server to the web client, and to refresh requests to communicate web documents and their embedded objects from the web server to the cache.

BACKGROUND OF THE INVENTION

1. 1. Field of the Invention

2. This invention relates to caches.

3. 2. Related Art

4. When presenting and reviewing data using a web browser or web client,that is, a client program for the web (the “World Wide Web”) such asNetscape Corporation's “Navigator” product or Microsoft Corporation's“Internet Explorer” product, it is desirable to present the data with aslittle delay as possible. If the user of the web client has to wait toolong for the data to be displayed, this can lead to userdissatisfaction.

5. Some web clients access the web using a proxy cache, that is, adevice for requesting web documents on behalf of the web client and forcaching those web documents for possible later use. The proxy cache actsto reduce the amount of communication bandwidth used between the webclient and web servers. A proxy cache can be shared by more than one webclient, in which case it acts to reduce the total amount ofcommunication bandwidth used between all of its web clients and webservers. One advantage of the proxy cache is that web documents storedin cache can be accessed more quickly than re-requesting those webdocuments from their originating web server.

6. One problem in the art is that a document requested by the web client(a “web document”) can include, in addition to text and directions fordisplay, embedded objects which are to be displayed with the webdocument. Embedded objects can include pictures, such as data in GIF orJPEG format, other multimedia data, such as animation, audio (such asstreaming audio), movies, video (such as streaming video), programfragments, such as Java, Javascript, or ActiveX, or other web documents,such as when using frames. The web client must parse the web document todetermine the embedded objects, and then request the embedded objectsfrom the web server.

7. While using a proxy cache ameliorates this problem somewhat, theproblem persists. If there are many embedded objects in the webdocument, it can take substantial time to identify, request,communicate, and display all of them. Parsing and requesting embeddedobjects by the web client is serial, and most web clients are set torequest only a small number of embedded objects at a time. Web clientsrequesting embedded objects perform this task in parallel with renderingthose objects for display, further slowing operation.

8. Moreover, known proxy caches use a two-level memory having bothprimary memory and secondary mass storage. Even those embedded objectsalready maintained in the cache, and thus accessible by the web clientwithout requesting them from the web server, might have been dropped outof the primary memory to secondary mass storage, possibly delayingcommunication of the embedded objects from the proxy cache to the webclient and thus delaying display of those embedded objects to the user.

9. Accordingly, it would be advantageous to provide a method and systemfor reducing latency in reviewing and presenting web documents to theuser. This advantage is achieved in a system in which web documents areparsed by a cache for references to embedded objects, and those embeddedobjects are pre-fetched from the web server or pre-loaded from secondarymass storage by the cache before they are requested by the web client.

10. Teachings of the art include (1) the known principle of computerscience that devices work better when they are indifferent to the natureof the data they process, and (2) the known principle of client-serversystems that it is advantageous to assign processing-intensive tasks toclients, rather than to servers, whenever possible. The invention iscounter to the first teaching, as the cache alters its behavior inresponse to its parsing of the web documents it receives forcommunication to the client. The invention is also counter to the secondteaching, as the cache takes on the additional processing tasks ofparsing the web document for embedded objects and, if necessary,independently requesting those embedded objects from the web server.

SUMMARY OF THE INVENTION

11. The invention provides a method and system for reducing latency inreviewing and presenting web documents to the user. A cache coupled toone or more web clients request web documents from web servers on behalfof those web clients and communicates those web documents to the webclients for display. The cache parses the web documents as they arereceived from the web server, identifies references to any embeddedobjects, and determines if those embedded objects are already maintainedin the cache. If those embedded objects are not in the cache, the cacheautomatically pre-fetches those embedded objects from the web serverwithout need for a command from the web client.

12. In a preferred embodiment, the cache maintains a two-level memoryincluding primary memory and secondary mass storage. At the time the webdocument is received, the cache determines if any embedded objects aremaintained in the cache but are not in primary memory. If those embeddedobjects are not in primary memory, the cache automatically pre-loadsthose embedded objects from secondary mass storage to primary memorywithout need for a request from the web client.

13. In a preferred embodiment, web documents maintained in the cache areperiodically refreshed, so as to assure those web documents are not“stale” (changed at the web server but not at the cache). The inventionis applied both to original requests to communicate web documents andtheir embedded objects from the web server to the web client, and torefresh requests to communicate web documents and their embedded objectsfrom the web server to the cache.

BRIEF DESCRIPTION OF THE DRAWINGS

14.FIG. 1 shows a block diagram of a system for shared cache parsing andpre-fetch.

15.FIG. 2 shows a flow diagram of a method for shared cache parsing andpre-fetch.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

16. In the following description, a preferred embodiment of theinvention is described with regard to preferred process steps and datastructures. Those skilled in the art would recognize after perusal ofthis application that embodiments of the invention can be implementedusing one or more general purpose processors or special purposeprocessors or other circuits adapted to particular process steps anddata structures described herein, and that implementation of the processsteps and data structures described herein would not require undueexperimentation or further invention.

17. Inventions disclosed herein can be used in conjunction withinventions disclosed in one or more of the following patentapplications:

18. Provisional U.S. Application 60/048,986, filed Jun. 9, 1997, in thename of inventors Michael Malcolm and Robert Zarnke, titled “NetworkObject Cache Engine”, assigned to CacheFlow, Inc., attorney docketnumber CASH-001.

19. U.S. application Ser. No. 08/959,058, filed this same day, in thename of inventors Michael Malcolm and Ian Telford, titled “AdaptiveActive Cache Refresh”, assigned to CacheFlow, Inc., attorney docketnumber CASH-003.

20. These applications are referred to herein as the “CacheDisclosures,” and are hereby incorporated by reference as if fully setforth herein.

21. System Elements

22.FIG. 1 shows a block diagram of a system for shared cache parsing andpre-fetch.

23. A system 100 includes a cache 110, at least one client device 120,and at least one server device 130. Each client device 120 is coupled tothe cache 110 using a client communication path 121, such as a dial-upconnection, a LAN (local area network), a WAN (wide area network), orsome combination thereof. Similarly, each server device 130 is alsocoupled to the cache 110 using a server communication path 131, such asa dial-up connection, a LAN (local area network), a WAN (wide areanetwork), or some combination thereof. In a preferred embodiment, theclient communication path 121 includes a LAN, while the servercommunication path 131 includes a network of networks such as aninternet or intranet.

24. As used herein, the terms “client” and “server” refer to arelationship between the client or server and the cache 110, notnecessarily to particular physical devices. As used herein, one “clientdevice” 120 or one “server device” 130 can comprise any of thefollowing: (a) a single physical device capable of executing softwarewhich bears a client or server relationship to the cache 110; (b) aportion of a physical device, such as a software process or set ofsoftware processes capable of executing on one hardware device, whichportion of the physical device bears a client or server relationship tothe cache 110; or (c) a plurality of physical devices, or portionsthereof, capable of cooperating to form a logical entity which bears aclient or server relationship to the cache 110. The phrases “clientdevice” 120 and “server device” 130 refer to such logical entities andnot necessarily to particular individual physical devices.

25. The server device 130 includes memory or storage 132 having a webdocument 133, the web document 133 including references to at least oneembedded object 134. In a preferred embodiment, the web document 133 caninclude text and directions for display. The embedded object 134 caninclude pictures, such as data in GIF or JPEG format, other multimediadata, such as animation, audio (such as streaming audio), movies, video(such as streaming video), program fragments, such as Java, Javascript,or ActiveX, or other web documents, such as when using frames.

26. The cache 110 includes a processor 111, program and data memory 112,and mass storage 113. The cache 110 maintains a first set of web objects114 in the memory 112 and a second set of web objects 114 in the storage113. (Web objects 114 can comprise web documents 133 or embedded objects134 or both.)

27. In a preferred embodiment, the cache 110 includes a cache devicesuch as described in the Cache Disclosures defined herein, herebyincorporated by reference as if fully set forth therein.

28. The cache 110 receives requests from the client device 120 for a webobject 114 and determines if that web object 114 is present at the cache110, either in the memory 112 or in the storage 113. If the web object114 is present in the memory 112, the cache 110 transmits the web object114 to the client device 120 using the client communication path 121. Ifthe web object 114 is present in the storage 113 but not in the memory112, the cache 110 loads the web object 114 into the memory 112 from thestorage 113, and proceeds as in the case when the web object 114 wasoriginally present in the memory 112. If the web object 114 is notpresent in either the memory 112 or the storage 113, the cache 110retrieves the web object 114 from the appropriate server device 130,places the web object 114 in the memory 112 and the storage 113, andproceeds as in the case when the web object 114 was originally presentin the memory 112.

29. Due to the principle of locality of reference, it is expected thatthe cache 110 will achieve a substantial “hit rate,” in which manyrequests from the client device 120 for web objects 114 will be forthose web objects 114 already maintained by the cache 110, reducing theneed for requests to the server device 130 using the servercommunication path 131.

30. The cache 110 parses each web object 114 as it is received from theserver device 130, separately and in parallel to any web client programoperating at the client device 120. If the web object 114 is a webdocument 133 that includes at least one reference to embedded objects134, the cache 110 identifies those references and those embeddedobjects 134, and determines if those embedded objects 134 are alreadymaintained in the cache 110, either in the memory 112 or the storage113.

31. If those embedded objects 134 are not in the cache 110 at all, thecache 110 automatically, without need for a command from the web client,requests those embedded objects 134 from the server device 130.

32. The cache 110 has a relatively numerous set of connections to theserver communication path 131, and so is able to request a relativelynumerous set of embedded objects 134 in parallel from the server device130. Moreover, the cache 110 parses the web document 133 and requestsembedded objects 134 in parallel with the web client at the clientdevice 120 also parsing the web document 133 and requesting embeddedobjects 134. The embedded objects 134 are available to the cache 110,and thus to the client device 120, much more quickly.

33. If those embedded objects 134 are maintained in the cache 110, butthey are in the storage 113 and not in the memory 112, the cache 110automatically, without need for a command from the web client, loadsthose embedded objects 134 from the storage 113 into the memory 112.

34. In a preferred embodiment, those web objects 114 maintained in thecache 110 are periodically refreshed, so as to assure those web objects114 are not “stale” (changed at the server device 130 but not at thecache 110). To refresh web objects 114, the cache 110 selects one webobject 114 for refresh and transmits a request to the server device 130for that web object 114. The server device 130 can respond with a copyof the web object 114, or can respond with a message that the web object114 has not changed since the most recent copy of the web object 114 wasplaced in the cache 110. If the web object 114 has in fact changed, thecache 110 proceeds as in the case when a client device 120 requested anew web object 114 not maintained in the cache 110 at all. If the webobject 114 has in fact not changed, the cache 110 updates itsinformation on the relative freshness of the web object 114, as furtherdescribed in the Cache Disclosures.

35. Method of Operation

36.FIG. 2 shows a flow diagram of a method for shared cache parsing andpre-fetch.

37. A method 200 includes a set of flow points to be noted, and steps tobe executed, cooperatively by the system 100, including the cache 110,the client device 120, and the server device 130.

38. At a flow point 210, the client device 120 is ready to request a webdocument 133 from the server device 130. For example, the web document133 can comprise an HTML page having a set of embedded objects 134.

39. At a step 221, the client device 120 transmits a request for the webdocument 133, using the client communication path 121, to the cache 110.

40. At a step 222, the cache 110 determines if that web document 133 islocated in the memory 112 at the cache 110. If so, the cache 110proceeds with the step 225. Otherwise, the cache 110 proceeds with thestep 223.

41. At a step 223, the cache 110 determines if that web document 133 islocated in the storage 113 at the cache 110 (but not in the memory 112).If so, the cache 110 loads the web document 133 from the storage 113into the memory 112, and proceeds with the step 225. Otherwise, thecache 110 proceeds with the step 224.

42. At a step 224, the cache 110 transmits a request to the serverdevice 130 for the web document 133. The server device 130 receives therequest and transmits the web document 133 to the cache 110. The cache110 stores the web document 133 in the memory 112 and the storage 113and proceeds with the step 225.

43. At a step 225, the cache 110 transmits the web document 133 to theclient device 120 for display. In parallel, the cache 110 parses the webdocument 133 and determines if there are any references to embeddedobjects 134. If not, the cache 110 proceeds with the flow point 230.Otherwise, the cache proceeds with the step 226.

44. At a step 226, the cache 110 identifies the embedded documents 134and repeats the steps 222 through 226 inclusive (including repeatingthis step 226) for each such embedded document 134. Web documents 133 in“frame” format can refer to embedded documents 134 that are themselvesweb documents 133 and themselves refer to embedded documents 134, and soon. There is no prospect of an infinite loop if web document 133 isself-referential because the cache 110 will simply discover at thesecond reference that the web document 133 is already maintained in thecache 110.

45. At a flow point 230, the web document 133 and all its embeddedobjects 134 have been transmitted to the client device 120 for display.

46. When the cache 110 refreshes a web object 114, the cache 110performs the steps 222 through 226 inclusive (including repeating thestep 226) for the web object 114 and for each identified embedded object134 associated with the web object 114.

47. Alternative Embodiments

48. Although preferred embodiments are disclosed herein, many variationsare possible which remain within the concept, scope, and spirit of theinvention, and these variations would become clear to those skilled inthe art after perusal of this application.

What is claimed is:
 1. A method, including the steps of receiving webdocuments at a shared cache from a web server or mass storage forcommunicating said web documents to a web client for display; parsingsaid web documents for references to embedded objects; determining ifsaid embedded objects are already maintained in said shared cache; andconditionally pre-fetching said embedded objects from said web server inresponse to said step of determining, without need for a command fromsaid web client.
 2. A method as in claim 1 , including the steps ofmaintaining at said shared cache a two-level memory including primarymemory and secondary mass storage; locating said embedded objects insaid shared cache but not in said primary memory; conditionallypre-loading said embedded objects from said secondary mass storage intosaid primary memory in response to said step of locating, without needfor a request from said web client.
 3. A method as in claim 1 , whereinsaid web documents include refresh copies of said web documentsrequested by said shared cache from said web server.
 4. A system,including a shared cache coupled to at least one web server and coupledto a plurality of web clients, said shared cache being capable ofreceiving requests for web documents from said web clients, requestingsaid web documents from said web server or mass storage, receiving saidweb documents from said web server or mass storage, and communicatingsaid web documents to said web clients; said shared cache includingmeans for parsing said web documents for references to embedded objects;means for determining if said embedded objects are already maintained insaid shared cache; and means for conditionally pre-fetching saidembedded objects from said web server in response to said means fordetermining, without need for a command from said web client.
 5. Asystem as in claim 4 , including a two-level memory at said sharedcache, said two-level memory including primary memory and secondary massstorage; means for locating said embedded objects in said shared cachebut not in said primary memory; and means for conditionally pre-loadingsaid embedded objects from said secondary mass storage into said primarymemory in response to said means for locating, without need for arequest from said web client.
 6. A system as in claim 4 , wherein saidweb documents include refresh copies of said web documents requested bysaid shared cache from said web server.
 7. A shared cache, includingmeans for parsing said web documents, said web documents being receivedfrom a web server or from mass storage, for references to embeddedobjects; means for determining if said embedded objects are alreadymaintained in said shared cache; and means for conditionallypre-fetching said embedded objects from said web server in response tosaid means for determining, without need for a command from said webclient.
 8. A cache as in claim 7 , including a two-level memory at saidshared cache, said two-level memory including primary memory andsecondary mass storage; means for locating said embedded objects in saidshared cache but not in said primary memory; and means for conditionallypre-loading said embedded objects from said secondary mass storage intosaid primary memory in response to said means for locating, without needfor a request from said web client.
 9. A cache as in claim 7 , whereinsaid web documents include refresh copies of said web documentsrequested by said shared cache from said web server.